<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('banner/index')}">轮播图列表管理</a></li>
        <li ><a href="{:url('banner/add')}">添加轮播图</a></li>
    </ul>

    <form method="post" action="{:url('Banner/px')}" class="js-ajax-form margin-top-20" >
        <div class="table-actions">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">排序</button>
        </div>
        <div style="margin: 10px 0;">

            <div style="margin: 10px 0;"></div>
            <table class="table table-hover table-bordered table-list">
                <thead>
                <tr>
                    <th><input type="checkbox" onclick="checkAll(this)"></th>
                    <th>排序</th>
                    <th>ID</th>
                    <th>图片</th>
                    <th>链接</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                <foreach name="list" item="vo">
                    <tr>
                        <td><input type="checkbox" name="id[]" value="{$vo.id}"></td>
                        <td><input type="text" name="list_orders[{$vo.id}]" value="{$vo.list_order}" class="input-order"></td>
                        <td>{$vo.id}</td>
                        <td><img src="{$vo.image}" class="img-thumbnail js-image-previewer" width="100px" height="100px"></td>
                        <td>{$vo.url}</td>
                        <td>
                            <a href="{:url('Banner/edit',array('id'=>$vo['id']))}">
                                    <span class="btn btn-xs btn-primary" title="{:lang('EDIT')}" data-toggle="tooltip">
                                        <i class="fa fa-edit fa-fw"></i>
                                    </span>
                            </a>

                            <a href="{:url('Banner/delete',array('id'=>$vo['id']))}" class="btn btn-xs btn-danger js-ajax-delete" data-toggle="tooltip" title="{:lang('DELETE')}" data-msg="确定删除吗？">
                                <i class="fa fa-trash fa-fw"></i>
                                </span>
                            </a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            <div class="pagination">
                {$list->render()}
            </div>
        </div>
    </form>

</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={}"></script>
<script>
    function checkAll(obj){
        var checkbox = document.getElementsByName('id[]')
        for(let i = 0; i<checkbox.length; i++){
            checkbox[i].checked = obj.checked;

        }
    }
</script>
</body>
</html>

<php>
    $cmf_version=cmf_version();
    if (strpos(cmf_version(), '6.') === 0) {
    $_app=app()->http->getName();
    }else{
    $_app=request()->module();
    }
</php>
<script type="text/javascript">
    //全局变量
    var GV = {
        ROOT: "__ROOT__/",
        WEB_ROOT: "__WEB_ROOT__/",
        JS_ROOT: "static/js/",
        APP: '{$_app}'/*当前应用名*/
    };
</script>
<script type="text/javascript" src="__STATIC__/js/js-image-previewer.js"></script>
<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/wind.js"></script>
<script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
<script>
    Wind.css('artDialog');
    Wind.css('layer');
    $(function () {
        $("[data-toggle='tooltip']").tooltip({
            container: 'body',
            html: true,
        });
        $("li.dropdown").hover(function () {
            $(this).addClass("open");
        }, function () {
            $(this).removeClass("open");
        });
    });
</script>
<if condition="APP_DEBUG">
    <style>
        #think_page_trace_open {
            z-index: 9999;
        }
    </style>
</if>
